package sk.naive.talker;

import java.util.Date;

/**
 *
 * @author <a href="mailto:virgo@naive.deepblue.sk">Richard "Virgo" Richter</a>
 * @version $Revision: 1.4 $ $Date: 2004/02/06 23:45:12 $
 */
public class TextRelation {
	private Integer objectId;
	private Integer textId;
	private int type;
	private long lastAccessed;

	public static final int USER_PROFILE = 0;
	public static final int BOARD_POST = 1;
	public static final int BOARD_POST_AUTHOR = 2;
	public static final int LOCATION_DESC = 3;

	public TextRelation(Integer objectId, Integer textId, int type, Date lastAccessed) {
		this.objectId = objectId;
		this.textId = textId;
		this.type = type;
		if (lastAccessed != null) {
			this.lastAccessed = lastAccessed.getTime();
		}
	}

	public Integer getObjectId() {
		return objectId;
	}

	public Integer getTextId() {
		return textId;
	}

	public int getType() {
		return type;
	}

	public Date getLastAccessed() {
		if (lastAccessed != 0) {
			return new Date(lastAccessed);
		}
		return null;
	}
}
